package com.example.design.patterns.冰河.创建型模式.抽象工厂.冰河;

import com.example.design.patterns.冰河.创建型模式.抽象工厂.冰河.abstractProduct.ICat;
import com.example.design.patterns.冰河.创建型模式.抽象工厂.冰河.abstractProduct.IDog;
import com.example.design.patterns.冰河.创建型模式.抽象工厂.冰河.concreteFactory.BlackAnimalFactory;
import com.example.design.patterns.冰河.创建型模式.抽象工厂.冰河.concreteFactory.WhiteAnimalFactory;

/**
 * Client：：仅使用由AbstractFactory 和 AbstractProduct 类声明的接口
 */
public class Test {
    public static void main(String[] args) {
        BlackAnimalFactory blackAnimalFactory = new BlackAnimalFactory();
        ICat blackCat = blackAnimalFactory.createCat();
        blackCat.eat();
        IDog blackDog = blackAnimalFactory.createDog();
        blackDog.eat();

        WhiteAnimalFactory whiteAnimalFactory = new WhiteAnimalFactory();
        ICat whiteCat = whiteAnimalFactory.createCat();
        whiteCat.eat();
        IDog whiteDog = whiteAnimalFactory.createDog();
        whiteDog.eat();
    }
}
